﻿using J.FoodManageSet.Application.Command.GroupingCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageSet.Application.CommandHandler.GroupingCommandHandler
{
    /// <summary>
    /// 菜品分组字段删除
    /// </summary>
    public class GroupingCommandHandler : IRequestHandler<GroupingCommand, int>
    {
        private readonly IGroupingRepository _groupingRepository;

        public GroupingCommandHandler(IGroupingRepository groupingRepository)
        {
            _groupingRepository = groupingRepository;
        }
        public async Task<int> Handle(GroupingCommand request, CancellationToken cancellationToken)
        {
            return await _groupingRepository.GroupingDeleteid(request.GroupingId,request.GroupingNum);
           
        }
    }
}
